package com.yalu.dao.data.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.yalu.dao.base.impl.BaseDaoImpl;
import com.yalu.dao.data.ItemDataDao;
import com.yalu.entity.data.ItemData;
import com.yalu.entity.data.ItemDataKey;

@Repository
public class ItemDataDaoImpl extends BaseDaoImpl<ItemData,ItemDataKey> implements ItemDataDao {

	@SuppressWarnings("unchecked")
	@Override
	public List<ItemData> getDataListByTime(String beginTime, String endTime) {
		String hql = "from " + ItemData.class.getName() + " as model where model.itemDataKey.data_date > ? and model.itemDataKey.data_date < ?";
		return  (List<ItemData>)getSession().createQuery(hql).setParameter(0, beginTime).setParameter(1, endTime).list();
	}

}
